/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxConsecutiveOnes = function (nums) {
  let res = 0,
    t = 0;
  for (let num of nums) {
    if (num == 1) {
      ++t;
    } else {
      res = Math.max(res, t);
      t = 0;
    }
  }
  return Math.max(res, t);
};
